using System;
using System.Collections.Generic;
using System.Drawing;
using System.Text;
using OpenComposite.Base.Designer;

namespace OpenComposite.EII.Designer.BObjects
{
	public class BOProcessSymbol : Symbol
	{
		#region Initialization
		public BOProcessSymbol()
		{
			init();
		}
		private void init()
		{
			this.BeginUpdate();

			//this.Name = "boProcessSymbol" + GetCount(typeof(BOProcessSymbol));
			this.Text = "";

			this.Size = new Size(30, 20);
			this.MinimumSize = new Size(10, 10);

			this.Border = BorderType.Rectangle;
			this.BorderColor = Color.Black;
			this.BorderWidth = 1;

			this.BackColor = Color.White;
			this.ForeColor = Color.Black;

			this.NameTextBox.Remove();
			//this.NameTextBox.BackColor = Color.Transparent;

			this.EndUpdate();
		}
		#endregion

		#region Public Members

		#region Properties (Overrided)
		public override bool CanFocused
		{
			get
			{
				return true;
			}
		}
		public override bool CanMove
		{
			get
			{
				return true;
			}
		}
		public override bool CanResize
		{
			get
			{
				return true;
			}
		}
		public override bool CanSelect
		{
			get
			{
				return true;
			}
		}
		public override bool NoClip
		{
			get
			{
				return true;
			}
		}
		#endregion

		#region Override
		public override void PaintBackground(System.Windows.Forms.PaintEventArgs pe)
		{
			base.PaintBackground(pe);
			Rectangle b = this.GetPaintBounds();
			float x1 = b.Left;
			float x2 = b.Left + ( b.Width / 3 );
			float x3 = b.Left + ( b.Width / 2 );
			float x4 = b.Right - ( b.Width / 3 );
			float x5 = b.Right;
			float y1 = b.Top;
			float y2 = b.Top + ( b.Height / 2 );
			float y3 = b.Top + (float)( b.Height * .75 );
			float y4 = b.Bottom;

			pe.Graphics.DrawLines(this.BorderPen,
				new PointF[] { new PointF(x1, y1), new PointF(x3, y3), new PointF(x5, y1) });
			pe.Graphics.DrawLine(this.BorderPen, x1, y4, x2, y2);
			pe.Graphics.DrawLine(this.BorderPen, x4, y2, x5, y4);
		}
		#endregion

		#endregion
	}
}
